package com.huanxing.cloud.security.exception;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.huanxing.cloud.security.config.HxExtendOauth2ExceptionSerializer;
import lombok.Getter;
import org.springframework.security.oauth2.common.exceptions.OAuth2Exception;

/**
 * 扩展OAuth2Exception
 *
 * @author lijx
 * @version 1.0
 * @date 2022/5/16 23:02
 */
@JsonSerialize(using = HxExtendOauth2ExceptionSerializer.class)
public class HxExtendOauth2Exception extends OAuth2Exception {

    @Getter
    private String errorCode;

    public HxExtendOauth2Exception(String msg) {
        super(msg);
    }

    public HxExtendOauth2Exception(String msg, Throwable t) {
        super(msg, t);
    }

    public HxExtendOauth2Exception(String msg, String errorCode) {
        super(msg);
        this.errorCode = errorCode;
    }
}
